#include "ParkinglotDB.h"
class SyncWrapper
{
private:
	void SyncAndUpdate();
	int ind;
public:
	SyncWrapper(){ind=0;ParkinglotDB::instance().InitLot();}
	map <int,ExtendedCar> UppercamV;
	map <int,ExtendedCar> GroundcamV;


	void CarEnteredUpperCam(int car_id);				//Upper cam reported entrence
	void CarEnteredGroundCam(int LP);					//Ground cam reported entrence
	bool CarParked (int car_id, int x, int y);		 	/*sets the parking place of an existing car, returns false if car_id is not in the database */
	int CarUnparked(int x, int y);						/*returns the car_id of the car in the parking place of (x,y), and updating the database accordingly*/
	void CarExits(int car_id);							/*this will delete a car from the parking lot*/

	
	int IsParkingAvailble(int parking_id);				/* return -1 if parking number parking_id is free, else retruns LP of the parking car*/
	int WhereIsMyCar(int license_plate);				/*returns some description of the car location , -2 if no such car, -1 if not parking yet (traveling)*/ 
	void PrintOccupiedSpots();							/*prints the occupied parking places*/ 
	string WhenEntered(int license_plate);				/*returns the time , when an existing car has entered*/ 
	void PrintLogToFile();								/* prints log to TXT file the describes for every parking is it empty or who parking there, and when he entered to the parking lot*/
	bool isThisParkingSlot(int x, int y);				/*return true if the current location is a parking space*/
	void getCarInfo( int carId , Socket* sock );
	void getParkingLotInfo( Socket* sock );
	string getLastExitVideo( int carId );
	void  addVideo( int carId, string video);
};